﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UFIDA.U8.Portal.Proxy.supports;
using UFIDA.U8.Portal.Proxy.editors;
using UFIDA.U8.Portal.Proxy.Actions;
using UFSoft.U8.Framework.Login.UI;
using UFIDA.U8.Portal.Framework.Actions;
using UFIDA.U8.Portal.Framework.MainFrames;
using System.Windows.Forms;

namespace zUpLoad
{
    #region 用友界面参数
    public class MyNetUserControl : INetUserControl
    {
        
        #region INetUserControl 成员
        System.Windows.Forms.Control  uccashflow = null;
        private IEditorInput _editInput = null;
        private IEditorPart _editPart = null;
        private string _title;
        public string _dllName;

        /// <summary>
        /// EditorInput
        /// </summary>
        public IEditorInput EditorInput
        {
            get
            {
                return _editInput;
            }
            set
            {
                _editInput = value;
            }
        }

        /// <summary>
        /// EditorPart
        /// </summary>
        public IEditorPart EditorPart
        {
            get
            {
                return _editPart;
            }
            set
            {
                _editPart = value;
            }
        }

        /// <summary>
        /// 页签标题
        /// </summary>
        public string Title
        {
            get
            {
                return this._title;
            }
            set
            {
                this._title = value;
            }
        }



        public bool CloseEvent()
        {
            //throw new Exception("The method or operation is not implemented.");
            return true;
        }

        public System.Windows.Forms.Control CreateControl(clsLogin login, string MenuID, string Paramters)
        {
            try
            {
                uccashflow = Common.cDll.getControl(this._dllName, this.Title);
                uccashflow.Name = this._title;
                return uccashflow;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }

        public UFIDA.U8.Portal.Proxy.Actions.NetAction[] CreateToolbar(clsLogin login)
        {

            IActionDelegate nsd = new NetSampleDelegate();
            NetAction ac = new NetAction("sss", nsd);
            NetAction[] aclist;
            aclist = new NetAction[1];
            ac.Text = "Sample Button 2";
            ac.Tag = uccashflow;
            aclist[0] = ac;
            return aclist;

            // throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }
    #endregion

}
